<?

  $binarydata = "AA\0A";
  $array = unpack("c2chars/nint", $binarydata);
//  foreach ($array as $key => $value)
     echo "\$array[$key] = $value <br>\n";

 $mynumstr = "100,000,000.75";
 $mynum = doubleval(str_replace(",","",$mynumstr));
 echo "Normal Value:".number_format($mynumstr);
echo "<br>******<br>";
var_dump(unpack('d', pack('i', 29 90 100 59 223 71 95 64)));
echo "******<br>";
echo "Normal Value: $mynum";
   echo "<br>";



$bindata="\29\90\100\59\223\71\95\64";
echo "29 90 100 59 223 71 95 64";
$i = 123456;
$ar = unpack("C*", pack("L", $i));

 echo "<br> $i $ar ";

 echo "<br>";

function _uint32be($bin){

    // $bin is the binary 32-bit BE string that represents the integer
    if (PHP_INT_SIZE <= 4){
        list(,$h,$l) = unpack('n*', $bin);
        return ($l + ($h*0x010000));
    }
    else{
        list(,$int) = unpack('N', $bin);
        return $int;
    }
}

?>
